plugins {
    id 'java'
    id 'org.springframework.boot' version '3.3.1'
    id 'io.spring.dependency-management' version '1.1.5'
}

group = 'ru.demo'
version = '0.0.1-SNAPSHOT'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

ext {
    mapstructVersion = '1.5.5.Final'
    liquibaseCoreVersion = '4.27.0'
    postgresqlVersion = '42.7.3'
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-amqp'
    annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'

    compileOnly "org.mapstruct:mapstruct:$mapstructVersion"
    annotationProcessor "org.mapstruct:mapstruct-processor:$mapstructVersion"

    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0'

    implementation "org.liquibase:liquibase-core:$liquibaseCoreVersion"
    runtimeOnly "org.postgresql:postgresql:$postgresqlVersion"

    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
    useJUnitPlatform()
}
